import { Component } from '@angular/core';
import {Carousel} from "../model/Carousel";
import {CarouselService} from "../service/carousel.service";
import {ConfigService} from "../service/config.service";

@Component({
  selector: 'app-tab3',
  templateUrl: 'tab3.page.html',
  styleUrls: ['tab3.page.scss']
})
export class Tab3Page {

    cl:Array<Carousel>;
    hosturl:string;
    slideOpts = {
        initialSlide: 1,
        speed: 400
    };

    constructor(private carouselservice:CarouselService,private config:ConfigService) {
        this.cl=new Array();
        this.hosturl=this.config.HOST;
        this.hosturl+="/public/";
    }


    ionViewWillEnter(){
        this.loadCarouselFormServer();
    }



    loadCarouselFormServer(){

        this.carouselservice.getCarouselList()
            .then((data:any)=>{
                this.cl=new Array();
                this.cl=data;


            })


    }

}
